from django.db import models

from utils.base import BaseModel


class PythonScript(BaseModel):
    name = models.CharField(verbose_name='函数名称', max_length=20)
    script = models.TextField(verbose_name='函数体')
    project = models.ForeignKey('projects.Project', on_delete=models.PROTECT)
    module = models.ForeignKey('envs.Module', on_delete=models.PROTECT)

    class Meta:
        db_table = 'tb_python'
        verbose_name = 'python脚本表'
        verbose_name_plural = verbose_name
